package com.webank.wedatasphere.qualitis.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class LocalTimeUtils {

    private  static final DateTimeFormatter YYYYMMDDHHMMSS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    private  static final DateTimeFormatter YYYYMMDD = DateTimeFormatter.ofPattern("yyyy-MM-dd");

    public static String getCurrentTime(){
        return LocalDateTime.now().format(YYYYMMDDHHMMSS);
    }
    public static String getCurrentTimeSimple(){
        return LocalDateTime.now().format(YYYYMMDD);
    }

    public static String getBeforeDaySimple(){
        return LocalDateTime.now().minusDays(1).format(YYYYMMDD);
    }
    public static String getBeforeMonthsSimple(){
        return LocalDateTime.now().minusMonths(1).format(YYYYMMDD);
    }

    public static String getBeforeWeekSimple(){
        return LocalDateTime.now().minusWeeks(1).format(YYYYMMDD);
    }
}
